package it.valeandre.omino;

import it.valeandre.omino.utils.Utils;

import java.util.HashSet;

import com.google.ads.Ad;
import com.google.ads.AdListener;
import com.google.ads.AdRequest;
import com.google.ads.AdView;
import com.google.ads.AdRequest.ErrorCode;

import android.support.v4.app.FragmentActivity;

public class BannerActivity extends FragmentActivity {

	protected AdView mAdView;
	
	protected void initBanners() {
		mAdView = (AdView)findViewById(R.id.adView);
		AdRequest adReq = new AdRequest();
		HashSet<String> keyWords = new HashSet<String>();   
		keyWords.add("Calcio");
		keyWords.add("Serie A");
		keyWords.add("Sport");
		keyWords.add("Soccer");
		keyWords.add("Football");
		keyWords.add("Risultati");
		adReq.setKeywords(keyWords);
		adReq.setGender(AdRequest.Gender.MALE);
		mAdView.setAdListener(new AdListener() {
			
			public void onReceiveAd(Ad arg0) {
				Utils.log("i", "BannerActivity onReceiveAd");
				
			}
			
			public void onPresentScreen(Ad arg0) {
				Utils.log("i", "BannerActivity onPresentScreen");
				
			}
			
			public void onLeaveApplication(Ad arg0) {
				Utils.log("i", "BannerActivity onLeaveApplication");
				
			}
			
			public void onFailedToReceiveAd(Ad arg0, ErrorCode arg1) {
				Utils.log("w", "BannerActivity onFailedToReceiveAd");
				
			}
			
			public void onDismissScreen(Ad arg0) {
				Utils.log("i", "BannerActivity onDismissScreen");
				
			}
		});
		mAdView.loadAd(adReq);
	}
	
}
